import os
import sys
import time
from images import downloadImageByPixabay

def _main():
    imagePath = './zaoqi'
    search = 'pets,cute'
    total = 93
    page = 1

    argvLenth = len(sys.argv)
    if argvLenth > 1:
        imagePath = sys.argv[1]
    if argvLenth > 2:
        search = sys.argv[2]
    if argvLenth > 3:
        total = int(sys.argv[3])
    if argvLenth > 4:
        page = int(sys.argv[4])

    print('run downloadImageByPixabay({} {} {} {})'.format(imagePath, search, total, page))
    downloadImageByPixabay(imagePath, search, total, page)

if __name__ == '__main__':
    _main()